/*
 * CS_SOCIAL_REQUEST_LOGOUT.cpp
 *
 *  Created on: 2013. 5. 27.
 *      Author: the2
 */



#include "../../Command.h"
#include "../../User.h"
#include "../../Proxy.h"
#include "../../../../protocol/iFriends.h"
#include "../../NLogic/Space.h"

namespace ProjectZ { namespace NCommand {

void Command::CS_SOCIAL_REQUEST_LOGOUT(User * pUser, ::Network::Packet * pPacket)
{
	PREPARE_PACKET;

//	LogOutSyn msg;
//	::ProjectZ::NProxy::SendFriendsServer(pUser->GetUserSeq(), msg);

	::Network::Packet * pAck = ::Network::GETPACKETPOOL()->SEND_NEW();
	* pAck << static_cast<int16_t>(ACK_OK);

	pAck->MakePacket(CMD_SC_SOCIAL_REQUEST_LOGOUT);
	pUser->Send(pAck);

	NLogic::Space * pSpace = pUser->GetSpace();
	if (NULL != pSpace)
		pSpace->LeaveUser(pUser);

	pUser->FlushCharacterInfo();
}

} /*NCommand*/ } /*ProjectZ*/
